import React, { useState, useEffect } from "react";
import { NavBar, Space, Toast } from "antd-mobile";
import Banner from "./compoent/banner";
import Category from "./compoent/Category";
// import Text from "./compoent/text"
import { Typography } from 'react-vant';
import { useNavigate, Link } from "react-router-dom";
import style from "./css/Home.module.css";
import { list } from "./sevice/postQuery";
import { Swiper } from "react-vant";
import Youthlist from "./compoent/Youthlist";
export default function () {
  let [listdata, setListData] = useState([]);

  const navigate = useNavigate();
  useEffect(() => {
    (async () => {
      let { data } = await list();
      console.log(data);
      setListData(data.data);
    })();
  }, []);
  useEffect(() => {
    console.log(listdata, "lallaflalflafas");
  }, [listdata]);

  return (
    <div className={style.rel}>

      <NavBar
        onBack={() => {
          navigate("/");
        }}
      >
        青年驿站
      </NavBar>
      <Banner list={listdata}></Banner>
      <Category list={listdata}></Category>
      {/* <div></div> */}
      <Youthlist></Youthlist>

    </div>
  );
}
